home *** CD-ROM | disk | FTP | other *** search
- Path: news.cern.ch!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: A real basic problem: long integers or compiler problem?
- Date: 19 Apr 96 00:26:17 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.829873577@news.cern.ch>
- References: <4l3mom$f26@newsbf02.news.aol.com>
- NNTP-Posting-Host: ues5.cern.ch
- Mime-Version: 1.0
- Content-Type: text/plain; charset=US-ASCII
- Content-Transfer-Encoding: 7bit
- X-Newsreader: NN version 6.5.0 #18 (NOV)
-
- In <4l3mom$f26@newsbf02.news.aol.com> theoder@aol.com (The Oder) writes:
-
- >I'm in the process of relearning C and have been doing some beginning
- >programs on my PC. I have two compilers (Borland C++ and Power C). My
- >problem is that when I run a program using "long" integers (i.e. declare a
- >variable as "long"), it locks up immediately and I have to reboot. This
- >has happened with both compilers and with two different really basic
- >programs (i.e. just trying to do a loop that will compute the first 10
- >powers of 2, and another one that simply just tries to find the largest
- >positive long value on my computer--> I can find the largest positive int
- >value, but when I convert it to long, it locks up)
- >
- >Is this a problem I have with BOTH (?!?!) compilers,
-
- Obviously not.
-
- >is it my computer
- >(486-DX2, 8 megs RAM) or settings,
-
- Probably not.
-
- >or is it just something I haven't
- >learned yet about long integers? One of these programs I copied directly
- >from one of TWO books I'm using and it just locks up!
-
- Post one of the programs (without omiting anything) and we'll tell you
- where is the problem. Without seeing the code it is impossible to find
- the bug(s).
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-